<% layout('/layouts/default.html', {title: '数据管理', libs:
['validate','fileupload','ueditor','dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text(ztGoods.isNewRecord ? '新增商品' :
				'编辑商品')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool"
					data-widget="collapse">
					<i class="fa fa-minus"></i>
				</button>
			</div>
		</div>
		<#form:form id="inputForm" model="${ztGoods}"
		action="${ctx}/ztGoods/save" method="post" class="form-horizontal">
		<div class="box-body">
			<div class="form-unit">${text('商品信息')}</div>
			<#form:hidden path="id"/>
			<#form:hidden path="ztGoodsid"/>
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('商品栏目类型')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
						
						<#form:select path="goodstemp"
							multiple="true" 
							dictType="zt_goodstemp_type" blankOption="true" class="form-control required"
							/>
							
							</div>
					</div>
				</div>
				
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('商品渠道类型')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
						
						<#form:select path="spotid"
							dictType="zt_spotid_type" blankOption="true" class="form-control required"
							/>
							
							</div>
					</div>
				</div>
				</div>
				<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-6" title=""> <span
							class="required">*</span> ${text('运费类型')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-6"><#form:select path="freightType" id="freightType"
							dictType="zt_freight_type" blankOption="true" class="form-control required" />
						</div>
					</div>
				</div>
				
				<div class="col-xs-6" id="freight">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('运费')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="freight" 
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control"/>
						</div>
					</div>
				</div>
				
			</div>
			
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('商品名')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="title"
							maxlength="200" class="form-control required "/></div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required ">*</span> ${text('关键词(‘，’分隔)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="keys"
							maxlength="230" class="form-control required"/></div>

					</div>
				</div>
			</div>

			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required hide">*</span> ${text('商品编号')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="code"
							maxlength="30" class="form-control"/></div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required hide">*</span><i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
						
						<% if (ztGoods!=null && ztGoods.id !=null){ %>
						<input id="retrieval" onclick="openWin('${ctx}/ztColor/list?ztGoods.id=${ztGoods.id}', 900, 600)"
				class="btn btn-primary" type="button" style="background:#00B2EE" value="设置商品颜色及库存" />
						<% } %>
						<% if (ztGoods==null || ztGoods.id ==null){ %>
						<input id="retrieval" onclick="openWin('${ctx}/ztColor/list?ztGoods.id=${ztGoods.ztGoodsid}', 900, 600)"
				class="btn btn-primary" type="button" style="background:#00B2EE" value="设置商品颜色及库存" />
						<% } %>
						
						</div> 
					</div>	
				</div>
			</div>

			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required"></span> ${text('品牌类型')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:select path="brandid" id="brandid"
							items="${brandList}" itemLabel="name" itemValue="id"
							blankOption="true" class="form-control "/></div>
					</div>
				</div>
				
				
				<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4">${text('商品类型')}：</label>
							<div class="col-sm-8">
							
								<#form:treeselect id="parent" title="${text('商品类型')}"
									path="type" labelPath="typeName" 
									url="${ctx}/goodsType/treeData"
									class="" allowClear="true" canSelectRoot="true" canSelectParent="true"/>
							
							</div>
						</div>
				</div>
				
				
			</div>

			<div class="row">
				<div class="col-xs-12">
					<div class="form-group">
						<label class="control-label col-sm-2" title=""> <span
							class="required hide">*</span> ${text('商品描述')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-10"><#form:textarea path="remarks"
							rows="4" maxlength="200" class="form-control"/></div>
					</div>
				</div>
			</div>
			
			
			

			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required hide">*</span> ${text('权重')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="weig"
							onkeyup="this.value=this.value.replace(/[^0-9-]+/,'');"
							maxlength="20" class="form-control required" /></div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required ">*</span> ${text('上架状态')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:radio path="sjStatus"
							dictType="zt_sj_type" class="form-control required" /></div>
					</div>
				</div>
			</div>


			

			<div class="row">
				<div class="col-xs-12">
					<div class="form-group">
						<label class="control-label col-sm-2" title=""> <span
							class="required hide">*</span> 商品详细信息：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-10"><#form:ueditor path="content"
							maxlength="20000" height="400" class="" simpleToolbars="true"
							readonly="false" outline="false"/></div>
					</div>
				</div>
			</div>
			
				<div class="row">
				<div class="col-xs-12">
					<div class="form-group">
						<label class="control-label col-sm-2">${text('商品封面图片上传：<br/>小图尺寸110*100<br/>轮播图尺寸375*225')}</label>
						<div class="col-sm-10">
						
						<#form:fileupload id="upload10" returnPath="true"
	filePathInputId="img" bizKey="${ztGoods.id}" bizType="user_upload10"
	uploadType="image" readonly="false" maxUploadNum="1" isMini="false"/>
<#form:input name="img" class="form-control"/>
							
							</div>
					</div>
				</div>
			</div>

			<div class="row">
				<div class="col-xs-12">
					<div class="form-group">
						<label class="control-label col-sm-2">${text('商品内容图片上传：<br/>尺寸375*325')}</label>
						<div class="col-sm-10">
						
						<#form:fileupload id="upload1" returnPath="true"
	filePathInputId="contentimgs" bizKey="${ztGoods.id}" bizType="user_upload1"
	uploadType="image" readonly="false" maxUploadNum="8" isMini="false"/>
<#form:input name="contentimgs" class="form-control"/>
							
							</div>
					</div>
				</div>
			</div>
			
			<div class="row">
				<div class="col-xs-12">
					<div class="form-group">
						<label class="control-label col-sm-2">${text('商品推广图片上传：<br/>尺寸700*1285')}</label>
						<div class="col-sm-10">
						
						
						<#form:fileupload id="upload2" returnPath="true"
	filePathInputId="qcode"  bizKey="${ztGoods.id}" bizType="user_upload2"
	uploadType="image" readonly="false" maxUploadNum="1" isMini="false"/>
	<#form:input name="qcode" class="form-control"/>

							</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-xs-12">
					<div class="form-group">
						<label class="control-label col-sm-2">${text('商品短视频上传')}：</label>
						<div class="col-sm-10">
					
							<#form:fileupload id="upload3" returnPath="true"
	filePathInputId="file"  bizKey="${ztGoods.id}" bizType="user_upload3"
	uploadType="media" readonly="false" maxUploadNum="1" isMini="false"/>
<#form:input name="file" class="form-control"/>
							</div>
					</div>
				</div>
			</div>
			
			
			<div class="form-unit">${text('商品价格')}</div>
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-5" title=""> <span
							class="required">*</span> ${text('商品供应价')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-7"><#form:input path="supplyPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-5" title=""> <span
							class="required">*</span> ${text('商品市场原价格')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-7"><#form:input path="origPrice" id="origPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control"/></div>
					</div>
				</div>
				</div>
				<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-5" title=""> <span
							class="required">*</span> ${text('会员卡折扣')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-7">
						
						<#form:select path="discount" id="discount"
							dictType="zt_discount_type" blankOption="true" class="form-control required"
							/>
							
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-5" title=""> <span
							class="required">*</span> ${text('会员卡折扣价')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-7">
						
						<#form:input path="discountPrice" id="discountPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required" disabled="disabled"/>
							
						</div>
					</div>
				</div>
				
			</div>
			
			<div class="form-unit" style="margin-left: 50px;">普通用户</div>
			<div class="row">
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-6" title=""> <span
							class="required">*</span> ${text('商品价：<br/>(折扣参照价)')}<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-6"><#form:input path="commonPrice" id="commonPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('一级佣金(普)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="commonOnePrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
			</div>
			
			<div class="form-unit" style="margin-left: 50px;">铜级掌柜用户</div>
			<div class="row">
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('商品价')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="copperPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('一级佣金(普)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="copperOnePrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('二级佣金(普)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="copperTwoPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-xs-4">
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('一级佣金(铜)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="tcopperOnePrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('二级佣金(铜)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="tcopperTwoPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
			</div>
				<div class="row">
				<div class="col-xs-4">
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('一级佣金(银)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="ycopperOnePrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('二级佣金(银)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="ycopperTwoPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
			</div>
				<div class="row">
				<div class="col-xs-4">
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('一级佣金(金)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="jcopperOnePrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('二级佣金(金)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="jcopperTwoPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
			</div>
			
			<div class="form-unit" style="margin-left: 50px;">银级掌柜用户</div>
			<div class="row">
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('商品价')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="silverPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('一级佣金(普)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="silverOnePrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('二级佣金(普)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="silverTwoPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-xs-4">
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('一级佣金(铜)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="tsilverOnePrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('二级佣金(铜)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="tsilverTwoPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-xs-4">
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('一级佣金(银)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="ysilverOnePrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('二级佣金(银)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="ysilverTwoPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-xs-4">
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('一级佣金(金)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="jsilverOnePrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('二级佣金(金)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="jsilverTwoPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
			</div>
			
			<div class="form-unit" style="margin-left: 50px;">黄金掌柜用户</div>
			<div class="row">
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('商品价')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="goldPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('一级佣金(普)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="goldOnePrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('二级佣金(普)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="goldTwoPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
			</div>
			
			<div class="row">
				<div class="col-xs-4">
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('一级佣金(铜)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="tgoldOnePrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('二级佣金(铜)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="tgoldTwoPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
			</div>
			
			<div class="row">
				<div class="col-xs-4">
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('一级佣金(银)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="ygoldOnePrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('二级佣金(银)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="ygoldTwoPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-xs-4">
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('一级佣金(金)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="jgoldOnePrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
				<div class="col-xs-4">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('二级佣金(金)')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="jgoldTwoPrice"
							onkeyup="this.value=this.value.replace(/[^0-9-.-]+/,'');"
							maxlength="10" class="form-control required"/></div>
					</div>
				</div>
			</div>
			
		
		</div>
		<div class="box-footer">
			<div class="row">
				<div class="col-sm-offset-2 col-sm-10">
					
					<button type="button" class="btn btn-sm btn-default" id="btnCancel"
						onclick="js.closeCurrentTabPage()">
						<i class="fa fa-reply-all"></i> ${text('关 闭')}
					</button>
				</div>
			</div>
		</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>

function openWin(u, w, h) { 
    var l = (screen.width - w) / 2; 
    var t = (screen.height - h) / 2; 
    var s = 'width=' + w + ', height=' + h + ', top=' + t + ', left=' + l; 
    s += ', toolbar=no, scrollbars=no, menubar=no, location=no, resizable=no'; 
    open(u, 'oWin', s); 
} 

	
window.onload=function (){

	$("#upload3dndArea p").text("或将视频拖到这里,最多可选 1 个");

}

$(function() {


	
	$("#brandid").change(function() {

		var brandid = $("#brandid").val();
	
		getGoodsType(brandid);

	});
	//原价
	$("#commonPrice").on('blur',function(){
	
		var origPrice = $("#commonPrice").val();
		
		var discount = $("#discount").val();
		if(origPrice != null && origPrice != undefined && origPrice !=''){	
		  if(discount != null && discount != undefined && discount !=''){
			  $("#discountPrice").val(((discount)*origPrice).toFixed(2));	
		  }
		  var commonOnePriceDis=${ztSk.commonOnePriceDis};
		  $("input[name='commonOnePrice']").val(((commonOnePriceDis)*origPrice).toFixed(2));
		  
		  var copperPriceDis=${ztSk.copperPriceDis};
		  $("input[name='copperPrice']").val(((1-copperPriceDis)*origPrice).toFixed(2));
		  var copperOnePriceDis=${ztSk.copperOnePriceDis};
		  $("input[name='copperOnePrice']").val(((copperOnePriceDis)*origPrice).toFixed(2));
		  var copperTwoPriceDis=${ztSk.copperTwoPriceDis};
		  $("input[name='copperTwoPrice']").val(((copperTwoPriceDis)*origPrice).toFixed(2));
		  
		  var silverPriceDis=${ztSk.silverPriceDis};
		  $("input[name='silverPrice']").val(((1-silverPriceDis)*origPrice).toFixed(2));
		  var silverOnePriceDis=${ztSk.silverOnePriceDis};
		  $("input[name='silverOnePrice']").val(((silverOnePriceDis)*origPrice).toFixed(2));
		  var silverTwoPriceDis=${ztSk.silverTwoPriceDis};
		  $("input[name='silverTwoPrice']").val(((silverTwoPriceDis)*origPrice).toFixed(2));
		  
		  var goldPriceDis=${ztSk.goldPriceDis};
		  $("input[name='goldPrice']").val(((1-goldPriceDis)*origPrice).toFixed(2));
		  var goldOnePriceDis=${ztSk.goldOnePriceDis};
		  $("input[name='goldOnePrice']").val(((goldOnePriceDis)*origPrice).toFixed(2));
		  var goldTwoPriceDis=${ztSk.goldTwoPriceDis};
		  $("input[name='goldTwoPrice']").val(((goldTwoPriceDis)*origPrice).toFixed(2));
		  
		  var tcopperOnePriceDis=${ztSk.tcopperOnePriceDis};
		  var tsilverOnePriceDis=${ztSk.tsilverOnePriceDis};
		  var tgoldOnePriceDis=${ztSk.tgoldOnePriceDis};
		  
		  $("input[name='tcopperOnePrice']").val(((tcopperOnePriceDis)*($("input[name='copperPrice']").val())).toFixed(2));
		  $("input[name='tsilverOnePrice']").val(((tsilverOnePriceDis)*($("input[name='silverPrice']").val())).toFixed(2));
		  $("input[name='tgoldOnePrice']").val(((tgoldOnePriceDis)*($("input[name='goldPrice']").val())).toFixed(2));
		  
		  var tcopperTwoPriceDis=${ztSk.tcopperTwoPriceDis};
		  var tsilverTwoPriceDis=${ztSk.tsilverTwoPriceDis};
		  var tgoldTwoPriceDis=${ztSk.tgoldTwoPriceDis};
		  $("input[name='tcopperTwoPrice']").val(((tcopperTwoPriceDis)*($("input[name='copperPrice']").val())).toFixed(2));		  
		  $("input[name='tsilverTwoPrice']").val(((tsilverTwoPriceDis)*($("input[name='silverPrice']").val())).toFixed(2));
		  $("input[name='tgoldTwoPrice']").val(((tgoldTwoPriceDis)*($("input[name='goldPrice']").val())).toFixed(2));
		  
		  var tcopperOnePriceDis=${ztSk.tcopperOnePriceDis};
		  var tsilverOnePriceDis=${ztSk.tsilverOnePriceDis};
		  var tgoldOnePriceDis=${ztSk.tgoldOnePriceDis};
		  
		  $("input[name='tcopperOnePrice']").val(((tcopperOnePriceDis)*($("input[name='copperPrice']").val())).toFixed(2));
		  $("input[name='tsilverOnePrice']").val(((tsilverOnePriceDis)*($("input[name='silverPrice']").val())).toFixed(2));
		  $("input[name='tgoldOnePrice']").val(((tgoldOnePriceDis)*($("input[name='goldPrice']").val())).toFixed(2));
		  
		  var tcopperTwoPriceDis=${ztSk.tcopperTwoPriceDis};
		  var tsilverTwoPriceDis=${ztSk.tsilverTwoPriceDis};
		  var tgoldTwoPriceDis=${ztSk.tgoldTwoPriceDis};
		  $("input[name='tcopperTwoPrice']").val(((tcopperTwoPriceDis)*($("input[name='copperPrice']").val())).toFixed(2));		  
		  $("input[name='tsilverTwoPrice']").val(((tsilverTwoPriceDis)*($("input[name='silverPrice']").val())).toFixed(2));
		  $("input[name='tgoldTwoPrice']").val(((tgoldTwoPriceDis)*($("input[name='goldPrice']").val())).toFixed(2));
		  
		  var ycopperOnePriceDis=${ztSk.ycopperOnePriceDis};
		  var ysilverOnePriceDis=${ztSk.ysilverOnePriceDis};
		  var ygoldOnePriceDis=${ztSk.ygoldOnePriceDis};
		  
		  $("input[name='ycopperOnePrice']").val(((ycopperOnePriceDis)*($("input[name='copperPrice']").val())).toFixed(2));
		  $("input[name='ysilverOnePrice']").val(((ysilverOnePriceDis)*($("input[name='silverPrice']").val())).toFixed(2));
		  $("input[name='ygoldOnePrice']").val(((ygoldOnePriceDis)*($("input[name='goldPrice']").val())).toFixed(2));
		  
		  
		  var ycopperTwoPriceDis=${ztSk.ycopperTwoPriceDis};
		  var ysilverTwoPriceDis=${ztSk.ysilverTwoPriceDis};
		  var ygoldTwoPriceDis=${ztSk.ygoldTwoPriceDis};
		  $("input[name='ycopperTwoPrice']").val(((ycopperTwoPriceDis)*($("input[name='copperPrice']").val())).toFixed(2));		  
		  $("input[name='ysilverTwoPrice']").val(((ysilverTwoPriceDis)*($("input[name='silverPrice']").val())).toFixed(2));
		  $("input[name='ygoldTwoPrice']").val(((ygoldTwoPriceDis)*($("input[name='goldPrice']").val())).toFixed(2));
		  
		  var jcopperOnePriceDis=${ztSk.jcopperOnePriceDis};
		  var jsilverOnePriceDis=${ztSk.jsilverOnePriceDis};
		  var jgoldOnePriceDis=${ztSk.jgoldOnePriceDis};
		  
		  $("input[name='jcopperOnePrice']").val(((jcopperOnePriceDis)*($("input[name='copperPrice']").val())).toFixed(2));
		  $("input[name='jsilverOnePrice']").val(((jsilverOnePriceDis)*($("input[name='silverPrice']").val())).toFixed(2));
		  $("input[name='jgoldOnePrice']").val(((jgoldOnePriceDis)*($("input[name='goldPrice']").val())).toFixed(2));
		  
		  
		  var jcopperTwoPriceDis=${ztSk.jcopperTwoPriceDis};
		  var jsilverTwoPriceDis=${ztSk.jsilverTwoPriceDis};
		  var jgoldTwoPriceDis=${ztSk.jgoldTwoPriceDis};
		  $("input[name='jcopperTwoPrice']").val(((jcopperTwoPriceDis)*($("input[name='copperPrice']").val())).toFixed(2));		  
		  $("input[name='jsilverTwoPrice']").val(((jsilverTwoPriceDis)*($("input[name='silverPrice']").val())).toFixed(2));
		  $("input[name='jgoldTwoPrice']").val(((jgoldTwoPriceDis)*($("input[name='goldPrice']").val())).toFixed(2));
		  
		}  

	});
	//折扣
	$("select[name='discount']").change(function() {
		var origPrice = $("#commonPrice").val();
		var discount = $("#discount").val();
		
		if(origPrice != null && origPrice != undefined && origPrice !=''){	
			  if(discount != null && discount != undefined && discount !=''){
				  $("#discountPrice").val(((discount)*origPrice).toFixed(2));	
			  }
			}  

	});
	
	
	

});
$(document).ready(
		function() {
			var freightType=$("#freightType").val();
			if(freightType==0){
				$("#freight").hide();
				
			}else{
				$("#freight").show();
			}
			$("#freightType").change(function() {
				var s = $(this).val();
				
				
				if(s==0){//文章
					$("#freight").hide();
				}else{//商品
					$("#freight").show();
				}
			});
			
		});
function getGoodsType(brandid) {

	// ajax请求所有市级单位
	$.get("${ctx}/brand/getType", {
		brandid : brandid
	}, function(data) {
		
		$("#parentCode").val(data.id);
		$("#parentName").val(data.name);
		
	}, 'json');
}


	$("#inputForm").validate({
		submitHandler : function(form) {
			js.ajaxSubmitForm($(form), function(data) {
				js.showMessage(data.message);
				if (data.result == Global.TRUE) {
					js.closeCurrentTabPage(function(contentWindow) {
						contentWindow.page();
					});
				}
			}, "json");
		}
	});
	
	function treeselectCallback(id, act, index, layero){
		if (id == 'parent' && (act == 'ok' || act == 'clear')){
			// 创建并初始化下一个节点信息，如：排序号、默认值
			$.get('${ctx}/goodsType/createNextNode?parentCode='
					+$('#parentCode').val(), function(data){
				$('#treeSort').val(data.treeSort);
			});
		}
	}
</script>